<template>
  <div>
    <el-dialog
      title="编辑第三方企业/会员"
      :visible.sync="dialogVisibleDetail"
      :close-on-click-modal="false"
      width="50%"
      :before-close="handleClose"
      @close="close"
    >
      <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px" class="demo-ruleForm">
        <el-form-item label="企业名称:">
          <el-input v-model="ruleForm.userGroupName" />
        </el-form-item>
        <el-form-item label="顶部名称:">
          <el-input v-model="ruleForm.nameTop" />
        </el-form-item>
        <el-form-item label="版权:">
          <el-input v-model="ruleForm.nameBottom" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer" />
    </el-dialog>
  </div>
</template>

<script>
import Vip from '@/api/axios/api/author/vip'
import Tip from '@/utils/tip'
export default {
  name: 'VipDetail',
  props: {
    hideDetailCompBoolean: Boolean,
    vipUidObjDetail: {}
  },
  data () {
    return {
      dialogVisibleDetail: false,
      ruleForm: {
        userGroupName: '',
        nameTop: '',
        nameBottom: ''
      },
      rules: {
        userGroupName: [
          { required: true, message: '请输入企业名称', trigger: 'blur' }
        ],
        nameTop: [
          { required: true, message: '请输入顶部名称', trigger: 'blur' }
        ],
        nameBottom: [
          { required: true, message: '请输入版权名称', trigger: 'blur' }
        ]
      }
    }
  },
  watch: {
    hideDetailCompBoolean: {
      handler () {
        this.dialogVisibleDetail = this.hideDetailCompBoolean
      }
    },
    vipUidObjDetail: {
      handler () {
        Vip.vipUuid(this.vipUidObjDetail).then(res => {
          if (res.status === 200) {
            this.ruleForm = JSON.parse(JSON.stringify(res.data))
          } else {
            Tip.error(res.data)
          }
        })
      }
    }
  },
  methods: {
    close () {
      this.$emit('hideDetailChildComp', false)
    },
    handleClose (done) {
      this.$emit('hideDetailChildComp', false)
    }
  }
}
</script>

<style scoped>

</style>
